<?php

$num = '身份证号17位';
$check_arr = [1,0,'X',9,8,7,6,5,4,3,2];
$vi = [7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];
$num_arr = str_split($num);
for($i=0;$i<count($num_arr);$i++){
	$S += $num_arr[$i]*$vi[$i];
}
$Y = $S%11;

echo $check_arr[$Y];

?>